<?php



class Social_Adapter_Linkedin extends Social_Adapter_OAuthAbstract
{

	/**
	 * @var string
	 */
	protected $_serviceId = 'linkedin';

	/**
	 * @return void
	 */
	function __construct()
	{
		require_once LEGACY_DIR . 'social/linkedin/linkedin_3.2.0.class.php';

	}
	
	/**
	 * @return LinkedIn
	 */
	function getClientApi()
	{

		if (NULL == $this -> _clientApi)
		{
			$key = Nuo::getConfig('linkedin','key');
			$secret = Nuo::getConfig('linkedin','secret');
		
		
			// display constants
			$apiConfig = array(
				'appKey' => $key,
				'appSecret' => $secret,
				'callbackUrl' => $this -> getCallbackUrl()
			);
			// init adapter.
			$clientApi = new LinkedIn($apiConfig);

			$this -> _clientApi = $clientApi;
		}
		
		return $this -> _clientApi;
	}

}
